{% extends 'layout.html' %}
{% from 'macro/page.html' import render_pagination %}
{% block main %}
<div class="card">
    <div class="card-header">
        <h3 class="card-title">
            <a class="btn btn-info btn-sm" href="{{ url_for('admins.category_create') }}">新建栏目</a>
        </h3>
    </div>
    <!-- /.card-header -->
    <div class="card-body table-responsive p-0" style="height: 650px;">
        <table class="table table-hover table-head-fixed">
            <thead>
            <tr>
                <th width="80px">ID</th>
                <th>栏目名称</th>
                <th>栏目路径</th>
                <th>作为菜单</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for item in record %}
            <tr>
                <td>{{ item.id }}</td>
                {%- if item.parent_id != 0 -%}
                <td style="text-indent:{{ 10* item.level|list|length }}px">
                    {{ item.mark }}
                    {%- else -%}
                <td>
                    {% endif %}
                    <a href="{{ item.url }}" class="no-pjax" target="_blank">{{ item.title }}</a>
                </td>

                <td>{{ item.path }}</td>
                <td>{{ item.is_menu }}</td>
                <td>
                    <a class="btn btn-info btn-sm"
                       href="{{ url_for('admins.category_modify', category_id=item.id, next=request.full_path) }}">编辑</a>
                </td>
            </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    <div class="card-footer clearfix">
    </div>
</div>
{% endblock %}